let navsecond = document.querySelector('.nav-second-body')
ajax({
  method: "get",
  url: "stage-api/website/getProductMenuInfo",
  success: function(res){
    console.log(res)
    for (let i = 0; i < res.data.length; i++) {
      if (i == 4) {
        continue;
      }else if(i == 6){
        continue;
      }else{
         navsecond.innerHTML += `<li class="nav-second-item" onclick="detail('${res.data[i].productId}')">
                                <div class="navsec-bod">
                                  <img src="${res.data[i].menuIcon.split("?")[0]}">
                                  <div>${res.data[i].productName}</div>
                                </div>
                              </li>`
      }
    }
  }
})

function detail(productId) {
      location.href = `product.html?productId=${productId}`
    }

console.log(location.href.split("=")[1])
let id = location.href.split("=")[1]

let centertitle = document.querySelector('.center-title')
let centertext = document.querySelector('.center-text')
ajax({
  method: "get",
  url: "stage-api/website/getCompanyDetails",
  params:{
    caseCompanyId: id,
  },
  success: function(res) {
    console.log(res)
    centertitle.innerText =  `${res.data.caseCompanyName}`
    centertext.innerHTML = `${res.data.caseCompanyIntroduce}`
  }
})